﻿@{
    ViewBag.Title = "产品详情";
    var id = Model != null ? Model.ID : 0;
}
@using ZBJF.Warranty.Common.Enums.InsuranceOrder
@using ZBJF.Warranty.Common.Enums.InsuranceProducts
@using ZBJF.Warranty.Common.Enums.InsuranceWarranty
@using ZBJF.Warranty.Model.ViewModel.InsuranceProducts
@using ZBJF.Warranty.Common.Enums.Data
@using ZBJF.Warranty.Common.Enums.InsuranceOrder.Data
@using ZBJF.Warranty.Common.Enums.InsuranceWarranty
@model ZBJF.Warranty.Model.InsuranceProducts
<ul class="nav nav-tabs">
    <li class="active"><a href="/InsuranceProducts/Detail/@id">产品详情</a></li>
</ul>
@using (Html.BeginForm("", "InsuranceProducts", FormMethod.Post, new { id = "mvcForm", name = "mvcForm", @class = "form-horizontal", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.HiddenFor(c => c.ID)
    <table class="table table-responsive table-bordered table-hover">
        <tr>
            <th class="w-p20">保险产品名称：</th>
            <td class="w-p30">
                @Html.DisplayFor(m => m.ProductName)
            </td>
            <th class="w-p20">保险产品ID：</th>
            <td>
                @Html.DisplayFor(m => m.ID)
            </td>
        </tr>
        <tr>
            <th>保险产品类型：</th>
            <td>
                @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(InsuranceProductCategory), Model.InsuranceProductCategory)
            </td>
            <th>被保险设备：</th>
            <td>
                @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(InsuranceOrderDevice), Model.InsuranceDevice)
            </td>
        </tr>
        <tr>
            <th>被保险设备类型：</th>
            <td>
                @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(InsuranceOrderDeviceType), Model.InsuranceDeviceType)
            </td>
            <th>保额：</th>
            <td>
                @Html.DisplayFor(m => m.Coverage)元
            </td>
        </tr>
        <tr>
            <th>配件类型：</th>
            <td>
                @{int i = 0;}
                @foreach (var item in Model.InsuranceProductScreenSPs)
                {
                    i++;
                    if (i % 2 == 0)
                    {
                        <span>/</span>
                    }
                    @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(InsuranceOrderScreenSPType), item.AccessoriesTypeID)
                }
            </td>
            <th>生效等待期：</th>
            <td>
                @Html.DisplayFor(m => m.WaitDays) 天
            </td>
        </tr>
        <tr>
            <th>新机投保时限：</th>
            <td>
                @Html.DisplayFor(m => m.NewMachineInsuranceTimeLimit)<span>天</span>
            </td>
            <th>保险期限：</th>
            <td>
                @Html.DisplayFor(o => o.PolicyPeriod)
                @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(InsuranceOrderPeriodUnit), Model.PolicyPeriodUnit)
            </td>
        </tr>
        <tr>
            <th>创建日期：</th>
            <td>
                @Html.TextBoxFor(m => m.CreateTime, new { @class = "Wdate", onclick = "WdatePicker({maxDate:'" + DateTime.Now.ToString("yyyy-MM-dd") + "'})" })
            </td>
            <th>产品创建人：</th>
            <td>
                @Html.DisplayFor(m => m.CreateBy)
            </td>
        </tr>
        <tr>
            <th>维修方式：</th>
            <td>
                @{int icount = 0;}
                @foreach (var item in Model.InsuranceProductWarrantyMaintenanceTypes)
                {
                    icount++;
                    if (icount % 2 == 0)
                    {
                        <span>/</span>
                    }
                    @ZBJF.Warranty.Common.Common.EnumHelper.Instance.GetDescription(typeof(WarrantyMaintenanceType), item.InsuranceWarrantyMaintenanceTypeId)
                }
            </td>
            <th></th>
            <td></td>
        </tr>
    </table>
}